package team.seekers.skill.service;

import org.springframework.transaction.annotation.Transactional;
import team.seekers.skill.entity.dao.Skill;
import com.baomidou.mybatisplus.extension.service.IService;
import team.seekers.skill.entity.query.SkillQuery;
import team.seekers.skill.entity.vo.admin.add.AdminSkillAddVO;
import team.seekers.skill.entity.vo.admin.update.AdminSkillUpdateVO;
import team.seekers.skill.entity.vo.fore.detail.SkillDetailVO;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hbc
 * @since 2021-01-18
 */
public interface SkillService extends IService<Skill> {

    @Transactional(rollbackFor=Exception.class)
    boolean add(AdminSkillAddVO adminSkillAddVO);

    @Transactional(rollbackFor=Exception.class)
    boolean delete(String skillId);

    @Transactional(rollbackFor=Exception.class)
    boolean update(AdminSkillUpdateVO adminSkillUpdateVO);

    @Transactional(rollbackFor=Exception.class)
    void updateSkillsHeat();

    AdminSkillUpdateVO getAdminSkillVO(String skillId);

    SkillDetailVO getSkillDetailVO(String skillId);

    @Transactional(rollbackFor=Exception.class)
    boolean startLearn(String skillId, String userId);

    @Transactional(rollbackFor=Exception.class)
    boolean endLearn(String skillId, String userId);

    Map<String,Object> pageSkillCondition(long current, long limit, SkillQuery skillQuery);

    Map<String, Object> adminPageSkillCondition(int current, int limit, SkillQuery skillQuery);
}
